
#ifndef  TEST_MOCKTICK_H
#define  TEST_MOCKTICK_H

#include "helper/watch/IClock.h"

class MockClock : public helper::watch::IClock<long long, long long> {
public:
    typedef helper::watch::IClock<long long, long long>::TimePoint TimePoint;
    typedef helper::watch::IClock<long long, long long>::Duration Duration;

    static const long long  EPOCH;
    static const long long  FIRST_TICK;
    static const long long  SECOND_TICK;

    TimePoint init() override{
        return EPOCH;
    }
    TimePoint now() override{
        static bool start = false;
        if(false == start){
            start = true;
            return FIRST_TICK;
        }
        else{
            start = false;
            return SECOND_TICK;
        }
    }
    const Duration diff(const helper::watch::Timespan<TimePoint> & ts) const override{
        return ts.end - ts.start;
    }
};

#endif   /* TEST_MOCKTICK_H */
